//
//  HMStatusCell.swift
//  VVeibo21
//
//  Created by apple on 2016/10/27.
//  Copyright © 2016年 Apple. All rights reserved.
//

import UIKit

class HMStatusCell: UITableViewCell {
    
    // 给原创微博赋值
    var stausViewModel:HMStatusViewModel?{
        
        didSet{
            originalView.statusViewModel = stausViewModel
        }
    }
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        // 设置视图
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

   // 设置视图
    private func setupUI(){
        
//        backgroundColor = HMRandomColor()
        
        contentView.addSubview(originalView)
        contentView.addSubview(bottomView)
        
        originalView.snp_makeConstraints { (make) in
            make.top.left.right.equalTo(contentView)
//            make.height.equalTo(50)
        }
        bottomView.snp_makeConstraints { (make) in
            make.top.bottom.right.equalTo(self)
            make.height.equalTo(35)
        }
    }
    
    // 懒加载控件
    // 原创微博
    private lazy var originalView:HMStatusOriginalView = HMStatusOriginalView()
    // 微博底部视图
    private lazy var bottomView:HMStatusBottomView = HMStatusBottomView()

}
